#-*-coding:utf-8-*-

# Autor: Pedro Lopes

import pickle
import csv

class Teste:
    def __init__(self,x):
        self.x = x
obj = Teste(49)
f = open('teste.dat','w')
p = pickle.dump(obj,f)
f.close()
del obj
obj = pickle.load(open("teste.dat","r"))
print obj.x

with open('listacompras.csv','rb') as csvfile:
    leitor = csv.reader(csvfile)
    for linha in leitor:
        print ",".join(linha)

with open('notas,csv','wb') as csvfile:
    escritor = csv.writer(csvfile)
    escritor.writerow(['P1',14])
    escritor.writerow(['P2',15])
    escritor.writerow(['LP',19])
